<template>
	<view class="music-head">
		<view class="music-head-item" v-if="icon" >
			<text class="iconfont icon-arrow-left" @tap="handleBack"></text> |
			<text class="iconfont icon-shouye" @tap="handleToHome"></text>
		</view>

		<view class="music-head-item-none" v-else>
		</view>
		<view class="title" :style={color:color}>
			{{ title }}
		</view>
		<view class="music-head-item-none">

		</view>
	</view>
</template>

<script>
	export default {
		name: "musichead",
		data() {
			return {

			};
		},
		props: ['title', 'icon','color'],
		methods: {
			handleBack() {
				uni.navigateBack();
			},
			handleToHome() {
				uni.navigateTo({
					url: '/pages/index/index'
				})
			}
		}
	}
</script>

<style scoped>
	.music-head {
		width: 100%;
		height: 35px;
		text-align: center;
		color: #000;
		font-size: 16px;
		display: flex;
		align-items: center;
		margin-top: 23px;
	}

	.music-head-item {
		width: 90px;
		height: 35px;
		background-color: rgba(0, 0, 0, 0.4);
		color: #ccc;
		border-radius: 15px;
		display: flex;
		align-items: center;
		justify-content: space-evenly;
		margin-left: 8px;

	}

	.music-head-item-none {
		width: 90px;
		height: 35px;
	}

	.title {
		width: calc(100vw - 90px - 90px - 8px);
		margin: 0 auto
	}
</style>